#ng  dag version 
#now runing

filename=test-dag-8.log
dag_time=test-dag-time-8.log

rm $filename
rm $dag_time
touch $filename
touch $dag_time

for sizei in  226
do 
  for sizej in 450
  do  
    for sizez in 18
    do
      for blkx in  7
      do 
        for blky in  7 
        do  
          for blkz in  16
          do
            for p in 64 # 4 8 16 32 64
            do
              swcc -O3 -DCHECK  -DSIZEX=$sizei -DSIZEY=$sizej -DSIZEZ=$sizez -DBLKX=$blkx -DBLKY=$blky -DBLKZ=$blkz -I/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/include -L/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/lib -c  3d7p_master.c  -ldag_task_scheduler -lstdc++ -lm   
              sw3cc -O3 -DCHECK -D__STRIDE_DMA -DSIZEX=$sizei -DSIZEY=$sizej -DSIZEZ=$sizez -DBLKX=$blkx -DBLKY=$blky -DBLKZ=$blkz -I/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/include -L/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/lib -c 3d7p_reuse_27.c  -ldag_task_scheduler -lstdc++ -lm
              sw3cc -O3  -hybrid -DCHECK -D__STRIDE_DMA  -DSIZEX=$sizei -DSIZEY=$sizej -DSIZEZ=$sizez -DBLKX=$blkx -DBLKY=$blky -DBLKZ=$blkz -I/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/include -L/mnt/export/base/caoj1/dag_task_scheduler_wuxi_dag/lib  -o 3d7p_reuse_27 3d7p_master.o 3d7p_reuse_27.o -ldag_task_scheduler -lstdc++ -lm
              for num in {1..5}
              do
                echo "dag runing, T=30 -DSIZEX=$sizei -DSIZEY=$sizej -DSIZEZ=$sizez -DBLKX=$blkx -DBLKY=$blky -DBLKZ=$blkz -Dthread_num=$p number=$num " 
                echo "dag runing, T=30 -DSIZEX=$sizei -DSIZEY=$sizej -DSIZEZ=$sizez -DBLKX=$blkx -DBLKY=$blky -DBLKZ=$blkz -Dthread_num=$p number=$num" >> $filename
                srun -b -m 1 -p host  -N 1 -n $p -s 4096  -K 256 ./3d7p_reuse_27 $p 100 >> $filename
                #tail $filename |awk '{print  '$sizei', '$sizej', '$sizez', '$blkx', '$blky', '$blkz', '$p', $1}'>>$dag_time 
              done
              rm *.o 3d7p_reuse_27 
            done
          done 
        done
      done
    done
  done
done
grep -E 'dag runing|exec time :' $filename>>$dag_time
